package com.cn.ant.modules.user.entity;

import com.cn.ant.common.persistence.MyDataEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 用户收藏Entity
 * @author 黄根华
 * @version 2015-10-25
 */
public class UserFavorite extends MyDataEntity<UserFavorite> {
	
	private static final long serialVersionUID = 1L;
	private String userId;		// 用户编号
	private String type;		// 收藏类型（volunteer，school，major）
	private String schoolCode;		// 学校国标
	private String schoolCodeSn;		// school_code_sn
	private String volunteerId;		// 组合编号
	private String majorCode;		// 专业国标
	private Date favoriteTime;		// 收藏时间
	
	public UserFavorite() {
		super();
	}

	public UserFavorite(String id){
		super(id);
	}

	@Length(min=0, max=32, message="用户编号长度必须介于 0 和 32 之间")
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	@Length(min=0, max=20, message="收藏类型（volunteer，school，major）长度必须介于 0 和 20 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	@Length(min=0, max=20, message="学校国标长度必须介于 0 和 20 之间")
	public String getSchoolCode() {
		return schoolCode;
	}

	public void setSchoolCode(String schoolCode) {
		this.schoolCode = schoolCode;
	}
	
	@Length(min=0, max=20, message="school_code_sn长度必须介于 0 和 20 之间")
	public String getSchoolCodeSn() {
		return schoolCodeSn;
	}

	public void setSchoolCodeSn(String schoolCodeSn) {
		this.schoolCodeSn = schoolCodeSn;
	}
	
	@Length(min=0, max=32, message="组合编号长度必须介于 0 和 32 之间")
	public String getVolunteerId() {
		return volunteerId;
	}

	public void setVolunteerId(String volunteerId) {
		this.volunteerId = volunteerId;
	}
	
	@Length(min=0, max=10, message="专业国标长度必须介于 0 和 10 之间")
	public String getMajorCode() {
		return majorCode;
	}

	public void setMajorCode(String majorCode) {
		this.majorCode = majorCode;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getFavoriteTime() {
		return favoriteTime;
	}

	public void setFavoriteTime(Date favoriteTime) {
		this.favoriteTime = favoriteTime;
	}
	
}